package com.bdqn.struts.action;


import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction2 extends ActionSupport {
    private String username;
    private String password;

    @Override
    public void validate() {
        if (this.getUsername().length()==0){
            addFieldError("name","用户名不能为空");
    }
    if (this.getPassword().length()==0){
        addFieldError("password","密码不能为空");
    }
}
    @Override
    public String execute() throws Exception {
            return Action .SUCCESS;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
